﻿using System;
using System.Collections.Generic;
using System.Text;

namespace SqlCe4Mvc3Application1.Models
{
    public partial class _Orchard_Widgets_WidgetPartRecord : RaisingStudio.Data.Expressions.TableExpression, RaisingStudio.Data.Expressions.IQueryExpression<_Orchard_Widgets_WidgetPartRecord>
    {
        #region Constructor (s) / Destructor
        /// <summary>
        /// Constructor (s) / Destructor.
        /// </summary>
        public _Orchard_Widgets_WidgetPartRecord() : base("Orchard_Widgets_WidgetPartRecord")
        {
        }
        #endregion
        #region Members
        public static readonly RaisingStudio.Data.Expressions.ColumnExpression _Id = "Id";
        public RaisingStudio.Data.Expressions.ColumnExpression Id { get { return _Id; } }
        public static readonly RaisingStudio.Data.Expressions.ColumnExpression _Title = "Title";
        public RaisingStudio.Data.Expressions.ColumnExpression Title { get { return _Title; } }
        public static readonly RaisingStudio.Data.Expressions.ColumnExpression _Position = "Position";
        public RaisingStudio.Data.Expressions.ColumnExpression Position { get { return _Position; } }
        public static readonly RaisingStudio.Data.Expressions.ColumnExpression _Zone = "Zone";
        public RaisingStudio.Data.Expressions.ColumnExpression Zone { get { return _Zone; } }

		#endregion

        public static implicit operator RaisingStudio.Data.Expressions.ConditionExpression(_Orchard_Widgets_WidgetPartRecord Orchard_Widgets_WidgetPartRecord)
        {
            return new RaisingStudio.Data.Expressions.ConditionExpression();
        }

        public RaisingStudio.Data.Expressions.ConditionExpression OrderBy(RaisingStudio.Data.Expressions.ColumnExpression columnExpression)
        {
             RaisingStudio.Data.Expressions.ConditionExpression conditionExpression = this;
             return conditionExpression.OrderBy(columnExpression);
        }

        public RaisingStudio.Data.Expressions.ConditionExpression OrderBy(RaisingStudio.Data.Expressions.ColumnExpression columnExpression, RaisingStudio.Data.Expressions.SortingDirection sortingDirection)
        {
            RaisingStudio.Data.Expressions.ConditionExpression conditionExpression = this;
            return conditionExpression.OrderBy(columnExpression, sortingDirection);
        }

        public RaisingStudio.Data.Expressions.ConditionExpression Where(RaisingStudio.Data.Expressions.ExpressionElement expressionElement)
        {
            RaisingStudio.Data.Expressions.ConditionExpression conditionExpression = this;
            return conditionExpression.Where(expressionElement);
        }

        public static implicit operator RaisingStudio.Data.Expressions.ColumnExpressionCollection(_Orchard_Widgets_WidgetPartRecord Orchard_Widgets_WidgetPartRecord)
        {
            return new RaisingStudio.Data.Expressions.ColumnExpressionCollection(Orchard_Widgets_WidgetPartRecord);
        }

        public static implicit operator RaisingStudio.Data.Expressions.ColumnExpression[](_Orchard_Widgets_WidgetPartRecord Orchard_Widgets_WidgetPartRecord)
        {
            return new RaisingStudio.Data.Expressions.ColumnExpression[]
                        {                            
                            Orchard_Widgets_WidgetPartRecord.Id,
                            Orchard_Widgets_WidgetPartRecord.Title,
                            Orchard_Widgets_WidgetPartRecord.Position,
                            Orchard_Widgets_WidgetPartRecord.Zone,
                        };
        }

        public RaisingStudio.Data.Expressions.ColumnExpressionCollection Except(params RaisingStudio.Data.Expressions.ColumnExpression[] columns)
        {
            RaisingStudio.Data.Expressions.ColumnExpressionCollection columnExpressionCollection = this;
            return columnExpressionCollection.Except(columns);
        }

    
        public static implicit operator RaisingStudio.Data.Expressions.QueryExpression<_Orchard_Widgets_WidgetPartRecord>(_Orchard_Widgets_WidgetPartRecord Orchard_Widgets_WidgetPartRecord)
        {
            return new RaisingStudio.Data.Expressions.QueryExpression<_Orchard_Widgets_WidgetPartRecord>(Orchard_Widgets_WidgetPartRecord);
        }


        #region IQueryExpression<_Orchard_Widgets_WidgetPartRecord> 成员

        _Orchard_Widgets_WidgetPartRecord RaisingStudio.Data.Expressions.IQueryExpression<_Orchard_Widgets_WidgetPartRecord>.Value
        {
            get { return Orchard_Widgets_WidgetPartRecord._; }
        }

        #endregion

        #region IQueryExpression 成员

        RaisingStudio.Data.Expressions.TableExpression RaisingStudio.Data.Expressions.IQueryExpression.Table
        {
            get { return this; }
        }

        RaisingStudio.Data.Expressions.ConditionExpression RaisingStudio.Data.Expressions.IQueryExpression.Condition
        {
            get { return this; }
        }

        RaisingStudio.Data.Expressions.ColumnExpressionCollection RaisingStudio.Data.Expressions.IQueryExpression.Columns
        {
            get { return null; }
        }

        #endregion
    }

    partial class Orchard_Widgets_WidgetPartRecord
    {
        #region Members
        public static readonly _Orchard_Widgets_WidgetPartRecord _ = new _Orchard_Widgets_WidgetPartRecord();
		#endregion
    }
}
